﻿@model CoreHome.Admin.ViewModels.ArticleViewModel

<link rel="stylesheet" href="~/lib/editor.md/css/editormd.min.css" />
<script src="~/lib/editor.md/editormd.min.js"></script>

<div class="container">
    <h1 class="display-4">Editor</h1>
    <hr />

    @if(ViewBag.Warning is not null)
    {
        <div class="@ViewBag.Warning.Style alert-dismissible fade show">
            @ViewBag.Warning.Content
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
    }

    <form asp-action="@ViewBag.Action" method="post">

        <input asp-for="ArticleCode" type="hidden" />

        <label asp-for="Title"></label>*
        <span asp-validation-for="Title" class="text-danger"></span>
        <input id="Title" asp-for="Title" type="text" autocomplete="off" class="form-control" />

        <label asp-for="CategoryName"></label>*
        <span asp-validation-for="CategoryName" class="text-danger"></span>
        <input id="CategoryName" asp-for="CategoryName" type="text" autocomplete="off" class="form-control" />

        <label asp-for="TagStr"></label>*<label>（Use the '#' separation）</label>
        <span asp-validation-for="TagStr" class="text-danger"></span>
        <input id="TagStr" asp-for="TagStr" type="text" autocomplete="off" class="form-control" />

        <label asp-for="Overview"></label>*
        <span asp-validation-for="Overview" class="text-danger"></span>
        <input id="Overview" asp-for="Overview" type="text" autocomplete="off" class="form-control" />

        <label asp-for="Content"></label>*
        <span asp-validation-for="Content" class="text-danger"></span>
        <div id="editor">
            <textarea id="Content" asp-for="Content" class="form-control" rows="10" cols="100" placeholder="博客内容"></textarea>
        </div>

        <input type="submit" value="Upload" class="btn btn-success mt-2" />
    </form>

    <script type="text/javascript" src="~/js/blog/editor.min.js"></script>
</div>